/*gcc -c -o gtkText.o gtkText.c `pkg-config --cflags --libs gtk+-2.0`*/
#include "mygtk.h"
#include <gtk/gtk.h>

Widget_t *createEntry(const char* text, int max)
{
	GtkWidget *entry = gtk_entry_new();
	if (text)
		gtk_entry_set_text(GTK_ENTRY(entry), text);
	gtk_entry_set_max_length(GTK_ENTRY(entry), max);
	return entry;
}

void setMaxOfEntry(Widget_t *entry, int max)
{
	gtk_entry_set_max_length(GTK_ENTRY(entry), max);
}

void setTextOfEntry(Widget_t *entry, const char* text)
{
	gtk_entry_set_text(GTK_ENTRY(entry), (const char*) text);
}

const char* getTextOfEntry(Widget_t *entry)
{
	return gtk_entry_get_text(GTK_ENTRY(entry));
}

void setEnableOfEntry(Widget_t *entry, _Bool enable)
{
	gtk_editable_set_editable(GTK_EDITABLE(entry), enable);
}

void setVisibilityOfEntry(Widget_t *entry, _Bool visibility)
{
	gtk_entry_set_visibility(GTK_ENTRY(entry), visibility);
}